home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / vmed.arc / LCMAPR.CCC < prev    next >
Text File  |  1985-12-03  |  896b  |  48 lines

  1. /* lcmapper/ccc - March 10, 1984 - Jim Kyle
  2.  * creates function map for large LC programs with many
  3.  * #include files.
  4.  */
  5.  
  6. #include stdio/csh
  7. #option inlib
  8.  
  9. main()
  10. {    check("$main");    }
  11.  
  12. check(filename)    char *filename;
  13. {    char inbfr[81];
  14.     int k; 
  15.     while (!gets(inbfr,81))
  16.         switch(inbfr[0])    {
  17.             case 0:
  18.             case '.':
  19.                 continue;
  20.             case '#':
  21.                 switch(tolower(inbfr[1]))    {
  22.                     case 'e':
  23.                         return(NULL);
  24.                     case 'i':
  25.                         if (check(inbfr+9)!=NULL)
  26.                             return(EOF);
  27.                     default:
  28.                         continue;
  29.                 }
  30.             default:
  31.                 k=strfind(inbfr," ",0);
  32.                 if (k>=0)    {
  33.                     inbfr[k] = 0;
  34.                     printf("%-20s%s\n",inbfr,filename);
  35.                 }
  36.         }
  37.     return(EOF);
  38. }
  39.  
  40. gets(bfr,siz)    char *bfr;    int siz;
  41. {    int c;
  42.     while ((c=getchar())!=EOF && --siz)
  43.         if ((*bfr++ = c) == '\n')
  44.             break;
  45.     *--bfr = 0;
  46.     return(c=='\n'?0:EOF);
  47. }
  48.